package com.example.demo.pojo.dto;

import com.example.demo.enumeration.Campus;
import com.example.demo.enumeration.ItemCategory;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;

import java.util.List;

@Getter
@Setter
@ToString
public class UpdateItemDTO {
    private Long id;

    @NotBlank(message = "商品名称不能为空")
    @Length(min = 1, max = 40, message = "名称长度限定为1-40个字符")
    private String name;

    @NotBlank(message = "商品描述不能为空")
    private String description;

    @NotNull(message = "商品类别不能为空")
    private ItemCategory category;

    @NotNull(message = "商品校区不能为空")
    private List<Campus> campuses;

    public UpdateItemDTO() {
    }

    public UpdateItemDTO(Long id, String name, String description, ItemCategory category, List<Campus> campuses) {
        this.id = id;
        this.name = name;
        this.description = description;
        this.category = category;
        this.campuses = campuses;
    }
}
